package com.wjjun.data.datasource

import com.wjjun.base.data.model.BaseResponse
import com.wjjun.base.data.model.PageBean
import com.wjjun.base.data.source.BaseNetDataSource
import com.wjjun.data.api.TestApi
import com.wjjun.data.bean.ArticleBean
import com.wjjun.data.bean.BannerBean
import javax.inject.Inject

/**
 *
 * author : wangjunjun
 * date   : 2022/7/1
 * desc   :
 */
class TestNetDataSource @Inject constructor(
    private val api: TestApi
) : BaseNetDataSource() {

    public fun getApi() : TestApi{
        return  api
    }

    suspend fun getIndexList(page: Int): PageBean<ArticleBean> {
        return api.getHomeArticles(page).data
    }

    suspend fun getBanner(): List<BannerBean> {
        val response = api.getBanner()
        return response.data
    }
}